<template>
  <div id="app">
    <h1 v-bgred>
      <span>自定义指令</span>
    </h1>
    <hr />
    <p v-bgred v-bold>show</p>
  </div>
</template>

<script>
export default {
  name: 'App',
  directives:{
    bgred(element){
      element.style.backgroundColor = 'red'
    },
    bold(element){
      element.style.fontWeight = 'bold'
    }
  }
}
</script>

<style>

</style>
